char c[1000][1000];d[4000];a;l;main(i,j,x,y,n,e){for(scanf("%d\n",&e);gets(c[++a]+1););n=a=0;for(i=1;i<=e;i++)for(j=1;j<=e;j++){if(c[i][j]=='*')d[l*2]=i,d[1+2*l++]=j,a++;while(l){n=--l;x=d[2*n];y=d[2*n+1];c[x][y]=0;if(c[x][y+1]=='*'){d[n*2]=x;d[n++*2+1]=y+1;c[x][y+1]=0;}if(c[x][y-1]=='*'){d[n*2]=x;d[n++*2+1]=y-1;c[x][y-1]=0;}if(c[x+1][y]=='*'){d[n*2]=x+1;d[n++*2+1]=y;c[x+1][y]=0;}if(c[x-1][y]=='*'){d[n*2]=x-1;d[n++*2+1]=y;c[x-1][y]=0;}l=n;}}printf("%d\n",a);}
